from haystack import indexes

from .models import Tucao


class TucaoIndex(indexes.SearchIndex, indexes.Indexable):
    '''Tucao索引书记模型类'''
    text = indexes.CharField(document=True, use_template=True)
    id = indexes.IntegerField(model_attr='id')
    user = indexes.CharField(model_attr='user')
    content = indexes.CharField(model_attr='content')
    create_time = indexes.CharField(model_attr='create_time')
    follow_count = indexes.IntegerField(model_attr='follow_count')
    comment_count = indexes.IntegerField(model_attr='comment_count')

    def get_model(self):
        '''返回简历索引的模型类'''
        return Tucao
